package com.repository;

import com.entity.PropertyProjectInfo;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;

@Repository
public interface PropertyProjectInfoRepository extends JpaRepository<PropertyProjectInfo, Integer> {
    
    /**
     * 根据项目名称模糊查询物业项目信息
     * @param projectName 项目名称
     * @param pageable 分页参数
     * @return 物业项目信息分页结果
     */
    @Query("SELECT p FROM PropertyProjectInfo p WHERE p.projectName LIKE %:projectName%")
    Page<PropertyProjectInfo> findByProjectNameContaining(@Param("projectName") String projectName, Pageable pageable);

    PropertyProjectInfo findByProjectName(String projectName);

}